﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Service Tester</title>
    <script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#SubmitButton").click(function () {
                $.ajax({
                    type: "POST",
                    url: $("#ServiceAddress").val() + '/' + $("#ServiceFunction").val(),
                    data: $("#Parameters").val(),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(res) {
                        $("#answer").text(res.d);
                    },
                    error: function() {
                        $("#answer").text("There was a server issue...");
                    }
                });
            });
        });
    </script>
</head>
<body>
    <input type="text" id="ServiceAddress" placeholder="Enter the service address." />
    <br />
    <input type="text" id="ServiceFunction" placeholder="Enter the service function." />
    <br />
    <input type="text" id="Parameters" placeholder="Enter the parameters (as full fledged JSON)" />
    <button id="SubmitButton">Test Function!</button>
    <pre id="answer"></pre>
</body>
</html>
